home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Contributed / SpriteWorld / SpriteWorld Files / Headers / SpriteWorldUtils.h < prev    next >
Encoding:
Text File  |  2000-10-06  |  3.8 KB  |  194 lines  |  [TEXT/CWIE]

  1. ///--------------------------------------------------------------------------------------
  2. //    SpriteWorldUtils.h
  3. //
  4. //    Portions are copyright: © 1991-94 Tony Myles, All rights reserved worldwide.
  5. //
  6. //    Description:    constants, structures, and prototypes for sprite utilities
  7. ///--------------------------------------------------------------------------------------
  8.  
  9.  
  10. #ifndef __SPRITEWORLDUTILS__
  11. #define __SPRITEWORLDUTILS__
  12.  
  13. #ifndef __QUICKDRAW__
  14. #include <QuickDraw.h>
  15. #endif
  16.  
  17. #ifndef __ICONS__
  18. #include <Icons.h>
  19. #endif
  20.  
  21. #ifndef __QDOFFSCREEN__
  22. #include <QDOffscreen.h>
  23. #endif
  24.  
  25. #ifndef __SWCOMMON__
  26. #include <SWCommonHeaders.h>
  27. #endif
  28.  
  29. #ifndef __SPRITEWORLD__
  30. #include <SpriteWorld.h>
  31. #endif
  32.  
  33. #ifndef __SPRITELAYER__
  34. #include <SpriteLayer.h>
  35. #endif
  36.  
  37. #ifndef __SPRITE__
  38. #include <Sprite.h>
  39. #endif
  40.  
  41. #ifndef __SPRITEFRAME__
  42. #include <SpriteFrame.h>
  43. #endif
  44.  
  45.  
  46. enum
  47. {
  48.     kColorIconResType = 'cicn'
  49. };
  50.  
  51. #ifndef NewColorSearchProc
  52. #define NewColorSearchProc(x) (x)
  53. #endif
  54.  
  55. ///--------------------------------------------------------------------------------------
  56. //    sprite utilities function prototypes
  57. ///--------------------------------------------------------------------------------------
  58.  
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif
  62.  
  63. #if PRAGMA_ALIGN_SUPPORTED
  64. #pragma options align=mac68k
  65. #endif
  66.  
  67. extern RGBColor        gSWTransparentColor;
  68.  
  69. SW_FUNC OSErr SWCreateRegionFromCIconMask(
  70.     RgnHandle *maskRgn,
  71.     CIconHandle cIconH);
  72. /*
  73. SW_FUNC OSErr SWCreateRegionFromPict(
  74.     RgnHandle *pictRgnH,
  75.     PicHandle srcPictH);
  76. */
  77. SW_FUNC OSErr SWCreateRegionFromPictResource(
  78.     RgnHandle *pictRgnH,
  79.     short pictResID);
  80.  
  81. SW_FUNC OSErr SWGetCIcon(
  82.     CIconHandle* cIconH,
  83.     short iconResID);
  84.  
  85. SW_FUNC OSErr SWCreateRegionFromGWorldAndRect(
  86.     RgnHandle *maskRgn,
  87.     GWorldPtr maskGWorld,
  88.     Rect* frameRect);
  89.  
  90. SW_FUNC OSErr SWCreateRegionFromGWorldAndRectStart(
  91.     GWorldPtr *tempMaskGWorld,
  92.     short     maxWidth,
  93.     short     maxHeight);
  94.  
  95. SW_FUNC void SWCreateRegionFromGWorldAndRectFinish(
  96.     GWorldPtr tempMaskGWorld);
  97.  
  98. SW_FUNC OSErr SWCreateRegionFromGWorldAndRectPartial(
  99.     RgnHandle     *maskRgn,
  100.     GWorldPtr     maskGWorld,
  101.     GWorldPtr     tempMaskGWorld,
  102.     Rect*         frameRect);
  103.  
  104. SW_FUNC OSErr SWCreateGWorldFromPictResource(
  105.     SpriteWorldPtr destSpriteWorld,
  106.     GWorldPtr *pictGWorldP,
  107.     short pictResID);
  108.  
  109. SW_FUNC OSErr SWCreateGWorldFromPict(
  110.     SpriteWorldPtr destSpriteWorld,
  111.     GWorldPtr *pictGWorld,
  112.     PicHandle srcPictH);
  113.  
  114. SW_FUNC OSErr SWCreateGWorldFromCIconMask(
  115.     SpriteWorldPtr destSpriteWorld,
  116.     GWorldPtr *maskGWorldP,
  117.     CIconHandle cIconH);
  118.  
  119. SW_FUNC void SWInvertGWorld(
  120.     GWorldPtr gWorldP);
  121.  
  122. SW_FUNC void SWInvertRect(
  123.     GWorldPtr gWorldP,
  124.     RectPtr    rectP);
  125.  
  126. SW_FUNC void SWCopyGWorlds( 
  127.     GWorldPtr srcGWorldP, 
  128.     GWorldPtr dstGWorldP );
  129.  
  130. SW_FUNC void SWFlipPixelsHorizontally(
  131.     GWorldPtr dstGWorldP,
  132.     RectPtr rectP);
  133.  
  134. SW_FUNC void SWFlipPixelsVertically(
  135.     GWorldPtr dstGWorldP,
  136.     RectPtr rectP);
  137.  
  138. SW_FUNC void SWSetTransparentColor(
  139.     RGBColor *RGB);
  140.  
  141. SW_FUNC OSErr SWCreatePixelMaskFromGWorld( 
  142.     GWorldPtr pictureGWorld, 
  143.     GWorldPtr maskGWorld,
  144.     RectPtr rectP );
  145.  
  146. SW_FUNC OSErr SWCreateRegionMaskFromGWorld(
  147.     GWorldPtr pictureGWorld,
  148.     Rect     *pictureRect,
  149.     RgnHandle maskRegion );
  150.  
  151. SW_FUNC OSErr SWFixImageGWorld( 
  152.     GWorldPtr pictureGWorld, 
  153.     GWorldPtr maskGWorld,
  154.     RectPtr rectP );
  155.     
  156. SW_FUNC OSErr SWCreateMaskAndFixImage( 
  157.     GWorldPtr pictureGWorld, 
  158.     GWorldPtr maskGWorld,
  159.     RectPtr rectP );
  160.  
  161. SW_FUNC OSErr SWBlackenGWorld( 
  162.     GWorldPtr oldGWorld );
  163.  
  164. SW_FUNC OSErr SWWhitenGWorld(
  165.     GWorldPtr oldGWorld );
  166.  
  167. SW_FUNC OSErr SWFastWhitenGWorld(
  168.     GWorldPtr pictureGWorld );
  169.  
  170. SW_FUNC void SWClearStickyError(void);
  171.  
  172. SW_FUNC OSErr SWStickyError(void);
  173.     
  174. SW_FUNC void SWSetStickyIfError(
  175.     OSErr errNum);
  176.     
  177. SW_FUNC Boolean SWHasSystem7(void);
  178.  
  179. SW_FUNC OSErr SWGetProcessorType(short *processorType);
  180.  
  181. void SWAssertFail(char* filename, int lineNum);
  182.  
  183. #if PRAGMA_ALIGN_SUPPORTED
  184. #pragma options align=reset
  185. #endif
  186.  
  187. #ifdef __cplusplus
  188. }
  189. #endif
  190.  
  191.  
  192. #endif /* __SPRITEWORLDUTILS__ */
  193.  
  194.